using WatiNCF;
using WatiN.Core;

namespace Northwind.Watin.Controllers.Employees
{
    public class EmployeeController : PageController<EmployeeController>
    {
        public EmployeeDetailsController EmployeeDetailsController
        {
            get { return new EmployeeDetailsController(HomePage, this); }
        }

        public EmployeeController(IHomePageController homePage) : base(homePage)
        {
        }

        public EmployeeController(IHomePageController homePage, IPageController parentPage) : base(homePage, parentPage)
        {
        }

        public EmployeeDetailsController ViewEmployeeDetails(string employeeName)
        {
            ((TableCell) Browser.Span(Find.ByText(employeeName)).Parent).ParentTableRow.Link(Find.ByText("Details")).Click();
            return EmployeeDetailsController;
        }

        
    }
}